package com.wwj.core.wawa.service;

import com.github.pagehelper.Page;
import com.wwj.core.server.entity.ServerConfig;
import com.wwj.core.wawa.entity.Player;
import com.wwj.core.wawa.entity.PlayerAddress;
import com.wwj.core.wawa.entity.Room;
import com.wwj.core.wawa.entity.WaWaType;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/11/3.
 */
public interface IPlayerService {
    void addPlayer(Player player);

    Player findById(Integer id);

    Player findByInviteCode(String inviteCode);

    void dealBindInvitor(Player player, Player invitor) throws Exception;

    Page<Player> selectPlayerByPage(String search,int limit,int offset)throws Exception;

    List<Player> findByRoomId(int roomId);

    Page<Player> selectPlayerItemByPage(String search,int offset,int limit)throws Exception;

    void dealApplyDeliver(Player player, PlayerAddress playerAddress,  List<Integer> playRecordIds);

    Player dealLogin(Player player) throws Exception;

    Map<String, Object> dealPlay(Player player, Room room, WaWaType waWaType) throws Exception;

    Room dealEnterRoom(Player player, Room room);

    void dealLeaveRoom(Player player, Room room);

    Map<String, Object> dealContinuePlay(Player player, Room room, WaWaType waWaType) throws Exception;

    void updateStatus(int id)throws Exception;

    int updatePlayer(Player player) throws Exception;

    void dealPlayTimeOut(String token, String deviceId) throws Exception;

    void dealQueue(Player player, Room room);

    void dealDequeue(Player player, Room room);

    void updatePlayerInfo(Integer id, String nickName, Map<String, Object> headerIcon) throws Exception;

    void updatePlayerPlaySuccess(Integer id);

    void updatePlayerPlayFailed(Integer id);

    Page<Player> findRankByPage(int offset, int limit);

    Page<Player> findRoomRankByPage(int roomId, int offset, int limit);

    List<Player> selectPlayerByInvitorInPage(Integer invitorId, String search, int limit, int offset);
}
